#include "constant.h"
int count(int orig[ROW][COLUMN], int i, int j);
void process(int orig[ROW][COLUMN])
{
/*	int cp[ROW + 2][COLUMN + 2];
 */
	int i, j, sum;
	for (i = 0; i < (ROW - 1);i++){
		for (j = 0; j < (COLUMN - 1); j++){
			sum = count(orig, i, j);
			switch(sum){
				case 0:
					orig[i][j] = 0;
					break;
				case 1:
				case 4:
				case 5:
				case 6:
				case 7:
				case 8:
					orig[i][j] = 0;
					break;
				case 3:
					if (orig[i][j] = 0)
						orig[i][j] = 1;
					break;
			}
			printf("sum = %d\n", sum);
		}
	}
}

int count(int orig[ROW][COLUMN], int i, int j)
{
	int sum = 0;
	
	if (orig[i][j] = 1)
		sum++;
	if (orig[i-1][j] = 1)
		sum++;
	if (orig[i+1][j] = 1)
		sum++;
	if (orig[i][j-1] = 1)
		sum++;
	if (orig[i][j+1] = 1)
		sum++;
	return sum;
}
